import { defineConfig } from 'vite';
import vue from '@vitejs/plugin-vue';
import { resolve } from 'path';

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [vue()],
  resolve: {
    alias: [
      { find: '@assets', replacement: resolve(__dirname, 'src/assets') },
      { find: '@runtime', replacement: resolve(__dirname, 'src/runtime') },
      { find: '@components', replacement: resolve(__dirname, 'src/components') },
    ]
  },
  build: {
    // outDir: 'D:/平台UI/Platform/Externals/智能网联汽车环境感知系统虚拟仿真比赛软件/UI',
    outDir: 'D:/运行环境/P10059/UI',
    emptyOutDir: true,
    assetsDir: 'assets',
  },
  server: {
    cors: true,
    host: "127.0.0.1",
    open: true,
    proxy: {
      '/api': {
        target: 'http://virtual.eduhenghong.cn:4497/api',
        changeOrigin: true,
        rewrite: path => path.replace(/^\/api/, '')
      },
    },
  }
})
